package com.distribute.framework.core.lsf;

import org.springframework.beans.factory.InitializingBean;

import com.distribute.framework.core.lsf.protocol.ILsfChannel;

/**
 * 接口提供调用统一入口
 * @author uiu
 *
 */
public class LsfChannel implements ILsfChannel,InitializingBean{

	public Object invoker(String lsfKey,String visitKey,String serviceInterface, String methodName, Object[] params) throws Exception {
		Lsf lsf = Lsf.getLsf();
		if(lsf==null)
			throw new Exception("无法找到lsf - ["+lsfKey+"]");
		LsfProvider provider = lsf.getProvider();
		if(provider==null)
			throw new Exception("无法找到provider - ["+lsfKey+"]");
		return provider.invoker(visitKey,serviceInterface,methodName,params);
	}
	
	public void afterPropertiesSet() throws Exception {
		
	}
}